package org.feiye.studyday26;

public class Cilmber extends Thread {

	private int time;// 爬100米用的时间
	private int num;// 爬了几个100米

	public Cilmber(String n, int time, int num) {
		super(n);
		this.time = time;
		this.num = num;
	}

	@Override
	public void run() {
		for (int i = 0; i < 10; i++) {
			System.out.println(super.getName() + "耗时" + time + "毫秒爬完了" + "第" + num + "个" + "100米");
			try {
				sleep(time);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

	public static void main(String[] args) {
		Thread t = new Cilmber("年轻人", 400, 5);
		Thread t1 = new Cilmber("老年人", 1000, 3);
		t.start();
		t1.start();
	}
}
